﻿@model Tuple<Project, VacancyModel>
@{
    ViewBag.Title = "Проект '" + Model.Item1.Name + "' Вакансия " + Model.Item2.Vacancy.Name;
}
<style>
TD
{
	padding-left: 3em;
	padding-top: 1em
}
</style>
<h1>Проект <a href="@Url.Action("View", "Project", new { id = @Model.Item1.Id})">'@Model.Item1.Name'</a> Вакансия @Model.Item2.Vacancy.Name</h1>
<h2>Участники</h2>
<table>
<thead>
	<tr>
		<td>Аватар</td>
		<td>Имя</td>
        <td></td>
	</tr>
</thead>
<tbody>
	@foreach (var user in Model.Item2.SelectedUsers)
	{
		<tr>
			<td>@Avatar.Medium(user, imageClass:"profile_photo")</td>
			<td>@(Html.ActionLink<UserController>(x => x.View(user.Id), user.DisplayName))</td>
            <td>
                @if (Model.Item2.MyselfPos != -1 && !Model.Item2.IsProjectCompleted && user.Id == Model.Item2.CurrentUserId)
                  {
	                  using (Html.BeginForm("Revoke", "Vacancy", FormMethod.Post, new { @class = "ajaxForm" }))
	                  {
				            <input type="hidden" name="vacancyId" value="@Model.Item2.Vacancy.Id" />	
				            <input type="hidden" name="userId" value="@Model.Item2.CurrentUserId" />
                            <input type="submit" class="project_participantList_peoplesList_itsMe_undo_link" value="Отказаться"/>
	                   }
                  }
            </td>
		</tr>
	}
</tbody>
</table>


